package cn.springcloud.fix.consumer.config;

import cn.springcloud.fix.common.starter.config.DefaultWebMvcConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@EnableWebMvc
@Configuration
@ConditionalOnWebApplication
public class WebMvcConfig extends DefaultWebMvcConfig {

    @Override
    protected void addViewControllers(ViewControllerRegistry registry) {
        //https://www.cnblogs.com/geshanzsq/p/11089169.html
        // registry.addViewController("/login").setViewName("login");
        // registry.addViewController("/home").setViewName("home");
        // registry.addViewController("/").setViewName("index");
        // registry.addViewController("/").setViewName("forward:/index.html");
        // registry.addViewController("/").setViewName("forward:/index");
        // registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }
}
